<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="root" value="${pageContext.request.contextPath}"/>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt"%>
<html>

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
		<!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
		<meta name="renderer" content="webkit">
		<!--国产浏览器高速模式-->
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<!-- 公共样式 开始 -->
		<link rel="stylesheet" type="text/css" href="${root}/css/base.css">
		<link rel="stylesheet" type="text/css" href="${root}/css/iconfont.css">
		<script type="text/javascript" src="${root}/framework/jquery-1.11.3.min.js"></script>
		<link rel="stylesheet" type="text/css" href="${root}/layui/css/layui.css">
		<script type="text/javascript" src="${root}/layui/layui.js"></script>
		<!-- 滚动条插件 -->
		<link rel="stylesheet" type="text/css" href="${root}/css/jquery.mCustomScrollbar.css">
		<script src="${root}/framework/jquery-ui-1.10.4.min.js"></script>
		<script src="${root}/framework/jquery.mousewheel.min.js"></script>
		<script src="${root}/framework/jquery.mCustomScrollbar.min.js"></script>
		<script src="${root}/framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
		<!-- 公共样式 结束 -->
		
		<style>
			.layui-table img {
			    max-width: none;
			}
		</style>
	</head>

	<body>
		<div class="cBody">
			<div class="console">
				<form class="layui-form" method="post" id="SearchForm">
					<div class="layui-form-item">
						<div class="layui-input-inline">
							<input type="text" name="name" placeholder="输入电影名称" class="layui-input">
						</div>
						<div class="layui-input-inline">
		                    <select name="dis_id" id="dis_id" lay-filter="dis_id">
								<option value="">地区分类</option>
								<c:forEach var="d" items="${d_list}" >
									<option value="${d.id}">${d.name}</option>
								</c:forEach>
		                    </select>
		                </div>
						<div class="layui-input-inline">
							<select name="type_id" id="type_id" lay-filter="type_id">
								<option value="">类型分类</option>
								<c:forEach var="t" items="${t_list}" >
									<option value="${t.id}">${t.name}</option>
								</c:forEach>
							</select>
						</div>
						<button class="layui-btn" lay-submit lay-filter="formDemo" onclick="searchMovie()">检索</button>
					</div>
				</form>

				<script>
					layui.use('form', function() {
						var form = layui.form;

						//监听提交
						form.on('submit(formDemo)', function(data) {
							layer.msg(JSON.stringify(data.field));
							return false;
						});
					});
				</script>
			</div>

			<table class="layui-table">
				<thead>
					<tr>
						<th>订单号</th>
						<th>订单状态</th>
						<th>订单时间</th>
						<th>交易总价</th>
						<th>购买用户名</th>
						<th>用户手机号</th>
					</tr>
				</thead>
				<tbody id="showMovie">
				<c:forEach var="order" items="${order}">
					<tr>
						<td>${order.id}</td>
						<td>${order.paystate==0?"未支付":"已支付"}</td>
						<td><fmt:formatDate value="${order.order_time}" pattern="yyyy-MM-dd"/></td>
						<td>${order.money}</td>
						<td>${order.user.name}</td>
						<td>${order.user.telephone}</td>
					</tr>
				</c:forEach>

				</tbody>
			</table>
			
			<!-- layUI 分页模块 -->
			<div id="pages"></div>
			<script>
				layui.use('laypage', function() {
					var laypage = layui.laypage;
				
					//总页数大于页码总数
					laypage.render({
					    elem: 'pages'
					    ,count: 100
					    ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
					    ,jump: function(obj){
//					      console.log(obj)
					    }
					});
				});

			</script>
		</div>
	</body>

</html>